package com.ruoyi.customerSample.service.impl;


import com.ruoyi.customerSample.domain.SampleCirculationDetail;
import com.ruoyi.customerSample.mapper.SampleCirculationDetailMapper;
import com.ruoyi.customerSample.service.ISampleCirculationDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 样品流转记录详情单据Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-05
 */
@Service
public class SampleCirculationDetailServiceImpl implements ISampleCirculationDetailService
{
    @Autowired(required = false)
    private SampleCirculationDetailMapper sampleCirculationDetailMapper;

    /**
     * 查询样品流转记录详情单据
     * 
     * @param id 样品流转记录详情单据ID
     * @return 样品流转记录详情单据
     */
    @Override
    public SampleCirculationDetail selectSampleCirculationDetailById(String id)
    {
        return sampleCirculationDetailMapper.selectSampleCirculationDetailById(id);
    }

    /**
     * 查询样品流转记录详情单据列表
     * 
     * @param sampleCirculationDetail 样品流转记录详情单据
     * @return 样品流转记录详情单据
     */
    @Override
    public List<SampleCirculationDetail> selectSampleCirculationDetailList(SampleCirculationDetail sampleCirculationDetail)
    {
        return sampleCirculationDetailMapper.selectSampleCirculationDetailList(sampleCirculationDetail);
    }

    /**
     * 新增样品流转记录详情单据
     * 
     * @param sampleCirculationDetail 样品流转记录详情单据
     * @return 结果
     */
    @Override
    public int insertSampleCirculationDetail(SampleCirculationDetail sampleCirculationDetail)
    {
        return sampleCirculationDetailMapper.insertSampleCirculationDetail(sampleCirculationDetail);
    }

    /**
     * 批量新增样品流转单据
     * @param sampleCirculationDetails 样品流转记录详情单据
     * @return
     */
    @Override
    public int batchSampleCirculationDetail(List<SampleCirculationDetail> sampleCirculationDetails) {
        return sampleCirculationDetailMapper.batchSampleCirculationDetail(sampleCirculationDetails);
    }

    /**
     * 修改样品流转记录详情单据
     * 
     * @param sampleCirculationDetail 样品流转记录详情单据
     * @return 结果
     */
    @Override
    public int updateSampleCirculationDetail(SampleCirculationDetail sampleCirculationDetail)
    {
        return sampleCirculationDetailMapper.updateSampleCirculationDetail(sampleCirculationDetail);
    }

    /**
     * 批量删除样品流转记录详情单据
     * 
     * @param ids 需要删除的样品流转记录详情单据ID
     * @return 结果
     */
    @Override
    public int deleteSampleCirculationDetailByIds(String[] ids)
    {
        return sampleCirculationDetailMapper.deleteSampleCirculationDetailByIds(ids);
    }

    /**
     * 根据流转id删除详情单据
     * @param circulationId 样品流转记录详情单据ID
     * @return
     */
    @Override
    public int deleteSampleDetailBillByCid(String circulationId) {
        return sampleCirculationDetailMapper.deleteSampleDetailBillByCid(circulationId);
    }

    /**
     * 删除样品流转记录详情单据信息
     * 
     * @param id 样品流转记录详情单据ID
     * @return 结果
     */
    @Override
    public int deleteSampleCirculationDetailById(String id)
    {
        return sampleCirculationDetailMapper.deleteSampleCirculationDetailById(id);
    }
}
